// 解析全局中间件
module.exports=function(){
  return global.gem_config.globalMiddleware.reduce((pro,fun)=>{
       let index = fun.includes(":")?fun.indexOf(":")+1:fun.length;

       let file = loader(global.gem_config.routeMiddleware[fun.substring(0,index)]);
       if(!file){console.log("全局中间件",fun.substring(0,index),"不存在")}
       //解析参数
       pro.push({
           fun:file || (()=>{return "全局中间件"+fun.substring(0,index+1)+"不存在"}),
           parameter:fun.substring(index+1).split(",").filter(e=>e),
           name:fun.substring(0,index+1)
       });
       return pro;
   },[]);
}